const Router = require('koa-router');
const { verifyToken } = require('../controller/login.controller');
const { verifyIfHasIsMonth } = require('../middleware/overview.middle');
const { 
  overviewFinishRate,
  overviewUserWorkerAdd,
  overviewEvaluationRate,
  overviewOrderDealCount,
} = require('../controller/overview.controller');

const overviewRouter = new Router({ prefix: '/maintainers/overview' });

// 获取订单完成率（今日或本月）
overviewRouter.get('/order/finish/rate', verifyToken, verifyIfHasIsMonth, overviewFinishRate);

// 获取新增员工/用户量数据（今日或本月）
overviewRouter.get('/user/worker/add', verifyToken, verifyIfHasIsMonth, overviewUserWorkerAdd);

// 获取订单好评率及差评率
overviewRouter.get('/order/evaluation/rate', verifyToken, verifyIfHasIsMonth, overviewEvaluationRate);

// 获取订单交易数据
overviewRouter.get('/order/deal/count', verifyIfHasIsMonth, overviewOrderDealCount);

module.exports = overviewRouter;